import axios from "@/services/index";

export interface TenementDataType {
  id: string;
  name: string;
  person: string;
  tel: string;
  status: string;
  vacancyRate: number;
  propertyFee: number;
}

interface SearchParmasType {
  name: string;
  person: string;
}

/** 楼宇列表 */
export async function getTenementListService(params: SearchParmasType) {
  const result = (await axios.post(
    "/tenementList",
    params
  )) as TenementDataType[];
  return result;
}

export interface RoomDataType {
  roomNumber: number;
  decorationType: string;
  area: number;
  unitPrice: number;
  src: string;
}

interface RoomListDataType {
    rooms: RoomDataType[],
}

/** 房间列表 */
export async function getRoomListService(tenementId: string) {
  const result = await axios.post("/roomList") as RoomListDataType;
  return result;
}
